package com.xu.demo.proxyPattern;

import org.springframework.cglib.proxy.Enhancer;

// CGLIB代理类
public class CglibShoppingProxy {
    public static Shopping createProxy() {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(RealShopping.class);
        enhancer.setCallback(new ShoppingMethodInterceptor());
        return (Shopping) enhancer.create();
    }
}
